<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/views1/DTD/views1-transitional.dtd">
<f:view xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui">
	<p:dialog widgetVar="promptBuscaProva" modal="true" width="500"
		closable="true" header="Buscar Prova" minWidth="500"
		>
		<h:form id="formPromptBuscaProva">
			<div>
				<div class="prompt-div-label">Código: </div>
				<div class="prompt-div-campo">
					<p:inputText value="#{provaBean.varBuscaCodigo}" styleClass="input-mm"/>
				</div>
				<div class="prompt-div-label">Descrição: </div>
				<div class="prompt-div-campo">
					<p:inputText value="#{provaBean.varBuscaDescricao}" styleClass="input-mm" style="display: inline;float: left;"/>
					<ui:include src="/views/layout/ajaxStatus.xhtml" />
					<p:commandButton value="Filtrar" styleClass="prompt-btnFiltro" style="margin-top:-1px;"
						action="#{provaBean.filtrarProva}" update="formPromptBuscaProva:dataTableBuscaProva"/>
				</div>
				<div class="prompt-correcao">&nbsp;</div>
			</div>
			<div>
				<p:dataTable widgetVar="dataTableBuscaProva" 
							id="dataTableBuscaProva" 
							paginator="true"
							selection="#{provaBean.provaInstanceTemp}" 
							value="#{provaBean.provaList}" 
							selectionMode="single" 
							var="var"
							emptyMessage="Nenhum registro encontrado!" 
							rows="10" lazy="true"
							dynamic="true">
					<p:column headerText="Provas">  
			            <h:outputText value="#{var.codigo}" />  
			        </p:column> 
				</p:dataTable>
			</div>
 			<div style="text-align: right;">
           		<br/><p:separator /><br/>  
                <p:commandButton action="#{provaBean.selecionarProva}" value="Selecionar"
                 update="formPrincipal, @form" onclick="promptBuscaProva.hide()" />
                <p:commandButton type="button" value="Cancelar" onclick="promptBuscaProva.hide()"/>
            </div>
		</h:form>
	</p:dialog>
</f:view>